import { FC, lazy } from "react"
// 导入路由
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"

// 导入模块
const Login = lazy(() => import("../pages/login"))
const Home = lazy(() => import("../pages/home"))
const Detail = lazy(() => import('../pages/details'))
interface Props {}
const ReactRouter: FC<Props> = () => {
    return (
        <Router>
            <Routes>
                <Route path="/" element={<Home/>} />
                <Route path="/login" element={<Login/>} />
                <Route path="/detail" element={<Detail/>} />
                <Route path="/404" element={<h1>404</h1>} />
            </Routes>
        </Router>
    )
}

export default ReactRouter
